package com.github.dongglin.smart.spring.boot.plus.common.enums;

/**
 * 操作状态码状态枚举，长度共8位.
 */
public enum StatusCode implements BusinessCode {

    /*----------------------------通用类状态信息-----------------------------------*/

    /**
     * 成功
     */
    S0000000("00000000", "成功"),

    /**
     * 参数检查错误
     */
    C0000000("10000000", "参数检查错误"),

    C0000002("10000001", "签名错误"),


    IL0000000("20000000", "非法操作"),

    /**
     * 重复操作
     */
    BD0000000("40000000", "重复操作"),

    /**
     * 操作失败
     */
    BE0000000("50000000", "操作失败"),

    /**
     * 系统错误
     */
    E0000000("60000000", "系统错误");

    private String code;

    private String phrase;

    /**
     * 构造函数
     *
     * @param code   code
     * @param phrase msg
     */
    StatusCode(String code, String phrase) {
        this.code = code;
        this.phrase = phrase;
    }

    /**
     *
     * @return
     */
    @Override
    public String getCode() {
        return this.code;
    }

    /**
     *
     * @return
     */
    @Override
    public String getMsg() {
        return this.phrase;
    }
}
